#include <iostream>
#include <jsoncpp/json/json.h>

int main()
{
    Json::Value root;
    
    Json::Value item1;
    item1["key1"] = "value11";
    item1["key2"] = "value22";

    Json::Value item2;
    item2["key1"] = "value1";
    item2["key2"] = "value2";

    root.append(item1);
    root.append(item2);

    Json::StyledWriter writer_sty;
    std::string s1 = writer_sty.write(root);
    std::cout << s1 << std::endl;

    Json::FastWriter writer_fs;
    std::string s2 = writer_fs.write(root);
    std::cout << s2 << std::endl;
}
